import java.util.Scanner;

public class abc337_B {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        boolean flag = true;

        for(int i = 0; i < s.length(); ++ i ) {
            if(s.charAt(i) == 'B') {
                for(int j = i + 1; j < s.length(); ++ j ) {
                    if(s.charAt(j) == 'A') {
                        flag = false;
                        break;
                    }
                }
            }

            if(s.charAt(i) == 'C') {
                for(int j = i + 1; j < s.length(); ++ j ) {
                    if(s.charAt(j) == 'A' || s.charAt(j) == 'B') {
                        flag = false;
                        break;
                    }
                }
            }
        }
        if(flag){
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}
